package com.zyf.school.manager.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zyf.school.manager.domain.Staff;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component(value = "staffDao")
public interface StaffDao extends BaseMapper<Staff> {
    /*@Insert("insert into staff(id,name,age,sex,email,dd,wx,tel,jobNum,position,level,begintime,endtime) values(#{id},#{name},#{age},#{sex},#{email},#{dd},#{wx},#{tel},#{jobnum},#{position},#{level},#{begintime},#{endtime})")
    void insert(Staff staff);*/

    @Select("select * from staff where id like CONCAT('%',#{tel},'%')")
    List<Staff> queryById(String tel);

    @Select("select * from staff where name like CONCAT('%',#{name},'%')")
    List<Staff> queryByName(String name);
}
